<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add Teacher</title>
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/index1.css" type="text/css"></link>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
function add(){
	$.ajax({
		url:"doAddTeacher",
		type:"post",
		data:$("#form").serialize(),
	    dataType:"json",
	    success:function(msg){
	    	if(msg>0){
	    		alert("添加教师成功!");
	    		location.href="<%=request.getContextPath()%>/chart/tList";
	    	}else{
	    		alert("添加教师失败");
	    		location.href="test";
	    	}
	    }
	});
}	

</script>
</head>
<body>
<center>
<div style="margin-top: 30px;border: 1px;border-collapse: collapse;">
	<form id="form">
		<table>
			<tr align="center">
			<td>教师名称:</td>
			<td><input type="text" name="name"></td>
			</tr>
			<tr>
			<td>类型:</td>
			<td>
				<select name="type">
					<option value="1">讲师</option>
					<option value="2">班主任</option>
					<option value="3">主任</option>
				</select>
			</td>
			</tr>
			<tr align="center">
			<td>备注:</td>
			<td><input type="text" name="remarks"></td>
			</tr>
			<tr align="center">
				<td colspan="11"><input type="button" value="添加教师" onclick="add()"></td>
			</tr>
		</table>
	</form>
</div>	
</center>
</body>
</html>